﻿<%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="TreeGrid.aspx.cs"
    Inherits="Common_TreeGrid" Title="Untitled Page" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.3" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v8.3" Namespace="DevExpress.Web.ASPxTreeList"
    TagPrefix="dxwtl" %>

<%@ Register Src="../UseControl/PageCommon.ascx" TagName="PageCommon" TagPrefix="uc1" %>

<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dxwtl" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3.Export, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377C8E3B72B4073"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
    
<asp:Content ID="Content1" ContentPlaceHolderID="C1" runat="Server">

    <script type="text/javascript" src="../Script/Common.js"></script>
    <dxwtl:ASPxTreeList ID="treeList" ClientInstanceName="treeList" ClientVisible="true"
        runat="server" Width="100%"  >
        <Columns>
<dxwtl:TreeListDataColumn VisibleIndex="0" FieldName="Name"></dxwtl:TreeListDataColumn>
</Columns>
       
        <ClientSideEvents FocusedNodeChanged="function(s, e) { OnTreeNodeChanged(ajaxPanel,treeList,s,e); }" 
            EndCallback ="function(s,e) { OnTreeEndCallback(ajaxPanel,s,e); }" />
        <Templates><DataCell>
                <div class="treeCell">
                    <div class="treeCellImage">
                        <dxe:ASPxImage ID="ASPxImage1" ImageUrl="<%# GetIconUrl(Container) %>" 
                                Width="16" Height="16" IsPng="true" runat="server" /></div>
                    <div class="treeCellText"><%# Container.Text %></div>
                </div>
            
</DataCell>
</Templates>
    </dxwtl:ASPxTreeList>
    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="C2" runat="Server">
    <dxcp:ASPxCallbackPanel ID="ajaxPanel" ClientInstanceName="ajaxPanel"
        LoadingPanelText="数据加载中…" OnCallback="ajaxPanel_Callback" runat="server" HideContentOnCallback="False">
        <PanelCollection>
            <dxp:PanelContent runat="server">
                <div class="queryLine"></div>
                <div class="buttonLine" id="btn_line">
                    <uc1:PageCommon ID="commonPageCtrl" GridClientName="InfoGrid" OnExport="btnExport_Click" runat="server" >
                    </uc1:PageCommon>
                </div>
                <div class="infoGrid">
                    <dxwgv:ASPxGridView ID="InfoGrid" ClientInstanceName="InfoGrid" 
                        DataSourceID = "dataSource"
                        KeyFieldName="ID" Width="100%" runat="server"
                        OnCustomCallback="InfoGrid_CustomCallback"
                        OnInitNewRow="InfoGrid_InitNewRow"
                        OnRowDeleting="InfoGrid_RowDeleting"
                        OnRowValidating="InfoGrid_RowValidating" 
                        OnPreRender="InfoGrid_PreRender" AutoGenerateColumns="False" OnRowInserting="InfoGrid_RowInserting" OnRowUpdating="InfoGrid_RowUpdating"  >
                        <Columns>
                            <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" >
                                <HeaderTemplate>
                                    <input title="[选择/取消选择]本页所有行" onclick="InfoGrid.SelectAllRowsOnPage(this.checked);"
                                        style="vertical-align: middle;" id="chkPageSelectAll" type="checkbox" />
                                </HeaderTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                            </dxwgv:GridViewCommandColumn>
                            <dxwgv:GridViewDataComboBoxColumn  FieldName="ParentCategoryID" Caption="父分类" VisibleIndex="1" >
                                <PropertiesComboBox DataSourceID="dsCategory" EnableIncrementalFiltering="True" 
                                    TextField="Name" ValueField="ID" ValueType="System.String"   >
                                </PropertiesComboBox>
                            </dxwgv:GridViewDataComboBoxColumn>
                            <dxwgv:GridViewDataTextColumn FieldName="Name"  VisibleIndex="2" >
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewDataTextColumn FieldName="OrderNo"  VisibleIndex="3" >
                            </dxwgv:GridViewDataTextColumn>
                            <dxwgv:GridViewCommandColumn Caption="操作" VisibleIndex="4" >
                                <EditButton Visible="True" ></EditButton>
                                <DeleteButton Visible="True"></DeleteButton>
                            </dxwgv:GridViewCommandColumn>
                        </Columns>
                   </dxwgv:ASPxGridView>
                </div>
            </dxp:PanelContent>
        </PanelCollection>
    </dxcp:ASPxCallbackPanel>
    <asp:ObjectDataSource ID="dataSource" runat="server" DataObjectTypeName="OT.Module.Model.Category_MDL"
        TypeName="OT.Module.BLL.Category_BLL" 
        OnSelecting="dataSource_Selecting" SelectMethod="Select" 
        OnObjectCreating="ds_ObjectCreating">
        <SelectParameters>
            <asp:Parameter Name="parentKey" />
            <asp:Parameter Name="companyId" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="dsCategory" runat="server" 
        DataObjectTypeName="OT.Module.Model.Category_MDL"
        TypeName="OT.Module.BLL.Category_BLL" 
        SelectMethod="GetAll" 
        OnObjectCreating="ds_ObjectCreating" >
    </asp:ObjectDataSource>
</asp:Content>
